package com.dt.app.api.shopping.service.impl;

import com.dt.app.modules.shopping.entities.OrderItem;
import com.dt.app.modules.shopping.vo.OrderItemBean;
import com.dt.app.api.shopping.mapper.OrderItemMapper;
import com.dt.app.api.shopping.service.IOrderItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 鸿源塔基
 * @since 2023-02-27
 */
@Service
public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements IOrderItemService {
    public OrderItem getEntity(OrderItemBean bean){
        OrderItem entity = new OrderItem();
        entity.setOrderItemId(bean.getOrderItemId());
        entity.setOrderSalesId(bean.getOrderSalesId());
        entity.setSellersId(bean.getSellersId());
        entity.setHyUserId(bean.getHyUserId());
        entity.setProductId(bean.getProductId());
        entity.setProductTypePriceId(bean.getProductTypePriceId());
        entity.setZuhe(bean.getZuhe());
        entity.setCategoryPath(bean.getCategoryPath());
        entity.setGiftCertificateId(bean.getGiftCertificateId());
        entity.setItemType(bean.getItemType());
        entity.setAddTime(bean.getAddTime());
        entity.setQuantity(bean.getQuantity());
        entity.setPrice(bean.getPrice());
        entity.setDiscountPrice(bean.getDiscountPrice());
        entity.setLogisticsCost(bean.getLogisticsCost());
        entity.setItemTotal(bean.getItemTotal());
        entity.setItemStatus(bean.getItemStatus());
        return entity;
    }
    public OrderItemBean getBean(OrderItem entity){
        OrderItemBean bean = new OrderItemBean();
        bean.setOrderItemId(entity.getOrderItemId());
        bean.setOrderSalesId(entity.getOrderSalesId());
        bean.setSellersId(entity.getSellersId());
        bean.setHyUserId(entity.getHyUserId());
        bean.setProductId(entity.getProductId());
        bean.setProductTypePriceId(entity.getProductTypePriceId());
        bean.setZuhe(entity.getZuhe());
        bean.setCategoryPath(entity.getCategoryPath());
        bean.setGiftCertificateId(entity.getGiftCertificateId());
        bean.setItemType(entity.getItemType());
        bean.setAddTime(entity.getAddTime());
        bean.setQuantity(entity.getQuantity());
        bean.setPrice(entity.getPrice());
        bean.setDiscountPrice(entity.getDiscountPrice());
        bean.setLogisticsCost(entity.getLogisticsCost());
        bean.setItemTotal(entity.getItemTotal());
        bean.setItemStatus(entity.getItemStatus());
        return bean;
    }
}
